#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	int n,l,i,j,s=0,f=0;
	cin>>n;
	l=n;
	int a[n*10],b[n+1];
	memset(b,0,sizeof(b));
	for(i=0;i<n;i++) cin>>a[i];
	for(i=0;i<l;i++)
	{
		if(b[a[i]]==0) f=1-f;
		if(f==1){cout<<a[i]<<" ";b[a[i]]=1;}
		else{a[l]=a[i];l++;}
	}
	return 0;
}
